package com.ndpmedia.fb.pmd.configration.service.impl;

import com.ndpmedia.fb.pmd.configration.db.PropertiesRepository;
import com.ndpmedia.fb.pmd.configration.model.po.PropertiesPo;
import com.ndpmedia.fb.pmd.configration.service.PropertiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2014/10/12.
 */
@Service
public class PropertiesServiceImpl implements PropertiesService {
    @Autowired
    private PropertiesRepository propertiesRepository;

    @Override
    public List list(String appid, String configid) {
        return propertiesRepository.findAll(appid,configid);
    }

    @Override
    public PropertiesPo add(String appid, String configid, String key, String value,String description) {
        return propertiesRepository.save(appid, configid, key, value,description);
    }

    @Override
    public boolean delete(String propertiesid) {
        return propertiesRepository.delete(propertiesid);
    }

    @Override
    public boolean update(String propertiesid, String key, String value,String description) {
        return propertiesRepository.update(propertiesid,key,value,description);
    }
    @Override
    public boolean push(String appid, String configid,String propertiesid) {
        System.out.printf("push properties" + appid + "" + configid);
        return true;
    }

    @Override
    public boolean status(String propertiesid, String status) {
        return false;
    }
}
